package windowBuilderATM;

import java.text.NumberFormat;


public class ATMFunctions extends ATM {
	private double balance = 5000;
	NumberFormat nf = NumberFormat.getInstance();
	public ATMFunctions(){
	
	}
	
	public void addFunds(String amount){
		double funds = Double.parseDouble(amount);
		balance += funds;
		ATM.updateDisplay("You Deposited: " + funds);
	}
	
	public void withdrawFunds(String amount){
		double funds2 = Double.parseDouble(amount);
		if (funds2 > balance){
			ATM.updateDisplay("You don't have enough money!");
		}
		else{
		balance -= funds2;
		ATM.updateDisplay("You Withdrew: " + funds2);
		}
	}

	public void printBalance() {
		ATM.updateDisplay("Balance: " + balance);
	}

}
